package com.yun.many.spec.exception;


import com.yun.many.spec.enums.IResultCode;

/**
 * 业务异常工具类
 * <p>
 * 关于错误码的设计
 */
public class ExceptionUtils {
    public static void throwException(IResultCode code) {
        throw new BusinessException(code);
    }

    public static void throwException(IResultCode code, Throwable causeBy) {
        throw new BusinessException(code, causeBy);
    }

    public static void throwException(String code, String message) {
        throw new BusinessException(code, message);
    }

    public static void throwException(String code, String message, Throwable causeBy) {
        throw new BusinessException(code, message, causeBy);
    }
}
